/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
define(["mini/weavee/datagrid/DataGridColumn"], function(DataGridColumn){
    return function(){
        this.columns=new Array();
        this.rows=new Array();
        this.miniModelName=null;
        
        this.addColumn=function(dataGridColumn){
            this.columns[this.columns.length]=dataGridColumn;
        }
        
        this.addColumnByMap=function(map){
            var dataGridColumn=new DataGridColumn();
            dataGridColumn.setName(map['name']);
            dataGridColumn.setLabel(map['label']);
            dataGridColumn.setBinding(map['binding']);
            dataGridColumn.setBindingText(map['bindingText']);
            dataGridColumn.setBindingValue(map['bindingValue']);
            this.addColumn(dataGridColumn);
        }
        
        this.getColumns=function(){
            return this.columns;
        }
        
        this.setColumns=function(_columns){
            this.columns=_columns;
        }
        
        this.setColumnsByMap=function(_maps){
            this.columns=[];
            for(var i in _maps){
                this.addColumnByMap(_maps[i]);
            }
        }
        
        this.getRows=function(){
            return this.rows;
        }
        /**
         * each row is an array of cell values
         * @param {type} _rows
         * @returns {undefined}
         */
        this.setRows=function(_rows){
            this.rows=_rows;
        }
        this.addRow=function(_row){
            this.rows[this.rows.length]=_row;
        }
       
        this.getMiniModelName=function(){
            return this.miniModelName;
        }
        /**
         * set name of variable containing a mini model
         * @param {type} _miniModelName
         * @returns {undefined}
         */
        this.setMiniModelName=function(_miniModelName){
            this.miniModelName=_miniModelName;
        }
        return this;
    }
});

